statements = input().split(";")
a = b = c = 0
for statement in statements:
    elements = statement.split(":=")
    if elements[0] == 'a':
        a = eval(elements[1])
    elif elements[0] == 'b':
        b = eval(elements[1])
    elif elements[0] == 'c':
        c = eval(elements[1])
print(a,b,c)